<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="resources/css/layout.css" media="screen" />
<title>Insert title here</title>
</head>
<body>
	<%@include file="/WEB-INF/header.jsp"%>
	<table id="veilingTable">
		<thead>
			<tr>
				<th>Veiling</th>
				<th>${veilingBean.veilingNaam}</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>Veiling id</td>
				<td>${veilingBean.id}</td>
			</tr>

			<tr>
				<td>Beschrijving</td>
				<td>${veilingBean.beschrijving}</td>
			</tr>
			<tr>
				<td>Start prijs</td>
				<td>${veilingBean.formattedStartPrijs}</td>
			</tr>
		</tbody>
	</table>
	<br>
	<br>
	<br>

	<div id = "offset">
	<img src='<c:out value="${veilingBean.imageLink}"/>' width="300" height="300"/>
	</div>
	<br>
	<br>
	<br>

	<table id="veilingTable">
		<tbody>
			<tr>
				<td>begin datum</td>
				<td>${veilingBean.formattedBeginDatum}</td>
			</tr>
		
			<tr>
				<td>sluitings datum </td>
				<td>${veilingBean.formattedSluitingsDatum}</td>
			</tr>
			<tr>
				<td>Resterende tijd</td>
				<td>${veilingBean.resterendeTijd}</td>
			</tr>
		</tbody>
	</table>


	<table id="veilingTable">
		<thead>
			<tr>
				<th>Biedingen</th>
				<th></th>
			</tr>
		</thead>
		<tbody>
			<c:if test="${fn:length(veilingBean.biedingen) > 0}">
				<c:forEach items="${veilingBean.biedingen }" var="bod">
				<tr>
					<td>
					<c:out value="${bod.formattedBod}" /> op <c:out
						value="${bod.formattedDatum}" /> door <c:out
						value="${bod.biederNaam}" />
					</td>
				<tr>
				</c:forEach>
			</c:if>
		</tbody>
	</table>
	<br>
	<br>
	<c:if test="${veilingBean.isVoorbij == false && UserBean.id != veilingBean.eigenaarId 
					&& UserBean.loggedIn == true }">
					Plaats een bod
				<form name="Bod" action="VeilingServlet?newbod=<c:out value="${veilingBean.id}"/>"
					method="post">
			Bod: <input type="text" name="Bod" /><BR> <input type="submit"
				value="Plaats een bod" />
		</form>
	</c:if>	
	<%@include file="/WEB-INF/Message.jsp"%>
	<%@include file="/WEB-INF/footer.jsp"%>
</body>
</html>